<?php
	include_once('header.php');
	include_once('menu.php');
	include_once('content.php');
?>

<?php
	echo "<h3>Služobné cesty - " . $clovek->name . ' ' . $clovek->surname ."</h3>";
	
	?>
	<table style="width: 40%; margin-bottom: 30px;">
		<tr>
			<td><b>Oddelenie</b></td>
			<td><?php echo $clovek->department ?></td>
		</tr>
		<tr>
			<td><b>e-mail</b></td>
			<td><?php echo $clovek->email ?></td>
		</tr>
	</table>
	<?php
	if (isset($cesty) && !empty($cesty)){
		echo "<table>";
		echo '<tr><td><b>Mesto</b></td><td><b>Štát</b></td><td><b>organizácia</b></td></tr>';
		foreach ($cesty as $key => $obj) {
			echo '<tr><td>' . $obj['city'] . '</td><td>' . $obj['country'] . '</td><td>' . $obj['organization'] . '</td></tr>';
		} 
		echo "</table>";
	} else {
		echo "<p><b>" . $clovek->name . ' ' . $clovek->surname . "</b>ešte nebol priradený k žiadnému cestu." . "</p>";
	}
	echo anchor('people', 'Späť na ľudí');


?>

<?php
	include_once('footer.php');
?>